Package com.vasco.image.generator
Class ImageGeneratorSDK
java.lang.Object
com.vasco.image.generator.ImageGeneratorSDK
The Image Generator SDK main class. It can generate a QR code or a CrontoSign image.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic BWQRCodeResponsegenerateBWQRCode(int imageSize, String inputValue, int errorCorrectionLevel) Generates a black and white QR code imagestatic BufferedImagegenerateCrontoSign(int squareSize, String inputValue) Generates a CRONTO image for the corresponding input values.static BufferedImagegenerateCrontoSign(int squareSize, String inputValue, boolean onPaper) Generates a CRONTO image for the corresponding input values.static BufferedImagegenerateDynamicCrontoImage(int squareSize, String inputValue, boolean onPaper) Generates a CRONTO image for the corresponding input values.
-
Field Details
-
VERSION
Version of the Image Generator SDK- See Also:
-
-
Method Details
-
generateCrontoSign
public static BufferedImage generateCrontoSign(int squareSize, String inputValue) throws ImageGeneratorSDKException Generates a CRONTO image for the corresponding input values. A scrambling is applied on the input before generating the image. The output image is to be printed on paper.- Parameters:
squareSize- The size of a CrontoSign square. The minimum square size isImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE, and the maximum square size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZEinputValue- The hexadecimal string to encode- Returns:
- The CRONTO image
- Throws:
ImageGeneratorSDKException- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTYif the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONGif the input value is too longImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_HEXAif the input value is not an hexadecimal valueImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_EVENif the input length is not evenImageGeneratorSDKErrorCodes.CRONTOSIGN_SQUARE_SIZE_INVALID_VALUEif the square size is invalidImageGeneratorSDKErrorCodes.CRONTOSIGN_GENERATION_ERRORif an error occurred during the CrontoSign generationImageGeneratorSDKErrorCodes.INTERNAL_ERRORif an internal error is raised
-
generateCrontoSign
public static BufferedImage generateCrontoSign(int squareSize, String inputValue, boolean onPaper) throws ImageGeneratorSDKException Generates a CRONTO image for the corresponding input values. A scrambling is applied on the input before generating the image.- Parameters:
squareSize- The size of a CrontoSign square. The minimum square size isImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE, and the maximum square size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZEinputValue- The hexadecimal string to encode. The max size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_INPUT_VALUE_LENGTHonPaper- true if and only if the image is to be printed on paper- Returns:
- The CRONTO image
- Throws:
ImageGeneratorSDKException- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTYif the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONGif the input value is too longImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_HEXAif the input value is not an hexadecimal valueImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_EVENif the input length is not evenImageGeneratorSDKErrorCodes.CRONTOSIGN_SQUARE_SIZE_INVALID_VALUEif the square size is invalidImageGeneratorSDKErrorCodes.CRONTOSIGN_GENERATION_ERRORif an error occurred during the CrontoSign generationImageGeneratorSDKErrorCodes.INTERNAL_ERRORif an internal error is raised
-
generateDynamicCrontoImage
public static BufferedImage generateDynamicCrontoImage(int squareSize, String inputValue, boolean onPaper) throws ImageGeneratorSDKException Generates a CRONTO image for the corresponding input values. The size of the image is dynamic and depends on the inputValue length. CAUTION: The CRONTO images generated with this method cannot be scanned by VASCO hardware authenticators (e.g. DP760, DP780).- Parameters:
squareSize- The size of a CrontoSign square. The minimum square size isImageGeneratorSDKConstants.CRONTOSIGN_MIN_SQUARE_SIZE, and the maximum square size isImageGeneratorSDKConstants.CRONTOSIGN_MAX_SQUARE_SIZEinputValue- The hexadecimal string to encode. The max size isImageGeneratorSDKConstants.DYNAMIC_CRONTO_IMAGE_MAX_INPUT_VALUE_LENGTHonPaper- true if and only if the image is to be printed on paper- Returns:
- The CRONTO image
- Throws:
ImageGeneratorSDKException- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTYif the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONGif the input value is too longImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_HEXAif the input value is not an hexadecimal valueImageGeneratorSDKErrorCodes.INPUT_VALUE_NOT_EVENif the input length is not evenImageGeneratorSDKErrorCodes.CRONTOSIGN_SQUARE_SIZE_INVALID_VALUEif the square size is invalidImageGeneratorSDKErrorCodes.CRONTOSIGN_GENERATION_ERRORif an error occurred during the CrontoSign generationImageGeneratorSDKErrorCodes.INTERNAL_ERRORif an internal error is raised
-
generateBWQRCode
public static BWQRCodeResponse generateBWQRCode(int imageSize, String inputValue, int errorCorrectionLevel) throws ImageGeneratorSDKException Generates a black and white QR code image- Parameters:
imageSize- The side length of the generated image. The minimum image size isImageGeneratorSDKConstants.QRCODE_MIN_IMAGE_SIZE, and the maximum image size isImageGeneratorSDKConstants.QRCODE_MAX_IMAGE_SIZEinputValue- The alphanumeric string to encode. Supported values are : 0-9, A-Z (upper-case only), space, $, %, *, +, -, ., /, :errorCorrectionLevel- The error correction level (which isImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_LOW,ImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_MIDDLE,ImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_QUALITYorImageGeneratorSDKConstants.QRCODE_ERROR_CORRECTION_LEVEL_HIGH)- Returns:
- A
BWQRCodeResponseobject containing the QR code image and the associated boolean matrix - Throws:
ImageGeneratorSDKException- If an exception occurred, the following error code can be thrown:ImageGeneratorSDKErrorCodes.INPUT_VALUE_EMPTYif the input value is emptyImageGeneratorSDKErrorCodes.INPUT_VALUE_TOO_LONGif the input value is too longImageGeneratorSDKErrorCodes.QRCODE_IMAGE_SIZE_INVALID_VALUEif the image size is invalidImageGeneratorSDKErrorCodes.QRCODE_ERROR_CORRECTION_LEVEL_INVALID_VALUEif the error correction level is invalidImageGeneratorSDKErrorCodes.INTERNAL_ERRORif an internal error is raised
-